import React from 'react';
import { createRoot } from "react-dom/client";
// import './index.css';
import { Routes, Route, BrowserRouter } from 'react-router-dom';
import routers from './routers';
// import Dashboard from '/src/components/Dashboard';
import NotFount from '/src/pages/not-fount';
import Index from '/src/pages/index';

function App() {
  return (
    <BrowserRouter>
      <Routes>
        <Route path="/" element={<Index />}/>
        {routers?.map(([path, P]) => {
          return <Route key={path} path={path} element={<P />} />;
        })}
        <Route path="*" element={<NotFount />} />
      </Routes>
    </BrowserRouter>
  );
}

const root = createRoot(document.getElementById("root"));
root.render(<App />);
